#ifndef _SYS_UNIT_H_
#define _SYS_UNIT_H_

#include "FanObj.h"
#include "SysTypes.h"

#define UNIT_VTABLE(self)   ((UnitVTable*)((FanObj*)self)->vtable)


extern Type*    Unit_classType;
extern VTable*  Unit_classVTable;


/* [sys::Unit] Attributes */
struct Unit
{
  FanObj        super;
};


/* [sys::Unit] Virtual-table */
typedef struct UnitVTable
{
  FanObjVTable  super;
} UnitVTable;


/* [sys::Unit] Methods and fields */
void            Unit_make(Unit* self);
Bool            Unit_equals(Obj self, NullableObj that);
Int             Unit_hash(Obj self);
Str*            Unit_toStr(Obj self);
Unit*           Unit_define(Str* s);
Unit*           Unit_fromStr_1(Str* s);
Unit*           Unit_fromStr(Str* s, Bool checked);
List*           Unit_list(void);
List*           Unit_quantities(void);
List*           Unit_quantity(Str* quantity);
List*           Unit_ids(Unit* self);
Str*            Unit_name(Unit* self);
Str*            Unit_symbol(Unit* self);
Float           Unit_scale(Unit* self);
Float           Unit_offset(Unit* self);
Str*            Unit_definition(Unit* self);
Int             Unit_kg(Unit* self);
Int             Unit_m(Unit* self);
Int             Unit_sec(Unit* self);
Int             Unit_K(Unit* self);
Int             Unit_A(Unit* self);
Int             Unit_mol(Unit* self);
Int             Unit_cd(Unit* self);
Unit*           Unit_mult(Unit* self, Unit* that);
Unit*           Unit_div(Unit* self, Unit* b);
Float           Unit_convertTo(Unit* self, Float scalar, Unit* unit);


/* [sys::Unit] Type-system functions */
Type*           Unit_initType(void);
VTable*         Unit_initVTable(void);
void            Unit_initStatic(void);


#endif
